package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TReadingCardInfoMapper;
import com.ruoyi.system.domain.TReadingCardInfo;
import com.ruoyi.system.service.ITReadingCardInfoService;
import com.ruoyi.common.core.text.Convert;

/**
 * 阅览证信息Service业务层处理
 * 
 * @author wqzhao
 * @date 2022-06-10
 */
@Service
public class TReadingCardInfoServiceImpl implements ITReadingCardInfoService 
{
    @Autowired
    private TReadingCardInfoMapper tReadingCardInfoMapper;

    /**
     * 查询阅览证信息
     * 
     * @param id 阅览证信息主键
     * @return 阅览证信息
     */
    @Override
    public TReadingCardInfo selectTReadingCardInfoById(Long id)
    {
        return tReadingCardInfoMapper.selectTReadingCardInfoById(id);
    }

    /**
     * 查询阅览证信息列表
     * 
     * @param tReadingCardInfo 阅览证信息
     * @return 阅览证信息
     */
    @Override
    public List<TReadingCardInfo> selectTReadingCardInfoList(TReadingCardInfo tReadingCardInfo)
    {
        return tReadingCardInfoMapper.selectTReadingCardInfoList(tReadingCardInfo);
    }

    /**
     * 新增阅览证信息
     * 
     * @param tReadingCardInfo 阅览证信息
     * @return 结果
     */
    @Override
    public int insertTReadingCardInfo(TReadingCardInfo tReadingCardInfo)
    {
        tReadingCardInfo.setCreateTime(DateUtils.getNowDate());
        return tReadingCardInfoMapper.insertTReadingCardInfo(tReadingCardInfo);
    }

    /**
     * 修改阅览证信息
     * 
     * @param tReadingCardInfo 阅览证信息
     * @return 结果
     */
    @Override
    public int updateTReadingCardInfo(TReadingCardInfo tReadingCardInfo)
    {
        tReadingCardInfo.setUpdateTime(DateUtils.getNowDate());
        return tReadingCardInfoMapper.updateTReadingCardInfo(tReadingCardInfo);
    }

    /**
     * 批量删除阅览证信息
     * 
     * @param ids 需要删除的阅览证信息主键
     * @return 结果
     */
    @Override
    public int deleteTReadingCardInfoByIds(String ids)
    {
        return tReadingCardInfoMapper.deleteTReadingCardInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除阅览证信息信息
     * 
     * @param id 阅览证信息主键
     * @return 结果
     */
    @Override
    public int deleteTReadingCardInfoById(Long id)
    {
        return tReadingCardInfoMapper.deleteTReadingCardInfoById(id);
    }
}
